
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="author" content="m.jd.com">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css"
          href="/resources/wap/css/base2013.css" charset="gbk" />
    <link rel="stylesheet" type="text/css"
          href="/resources/wap/css/my.css?r=2" charset="gbk" />
    <link rel="stylesheet" type="text/css"
          href="/resources/wap/css/header.css" charset="gbk" />
    <link rel="stylesheet" type="text/css"
          href="/resources/wap/css/bottom.css" charset="gbk" />
    <script src="/resources/js/jquery-1.11.1.min.js"></script>
    <script src="/resources/js/self.js?r=2"></script>
    <style type="text/css">
        .padding_top{padding-top: 11px;}
        .orderStatistics{height:12.5px !important;}
        .center-span{font-size:16px;color:#0c91e5;}
        
    </style>
    <title>用户中心</title>
</head>
<body >
<header>
    <!-- 通用头 div -->
    <div id="m_common_header" style="min-height: 45px; margin-top: 0px;">
        <header class="jd-header">
            <div class="jd-header-bar">
                <div id="m_common_header_goback" class="jd-header-icon-back J_ping" onclick="javascript:window.location.href='/pages/wx/index.jsp';">
                    <span></span>
                </div>
                <div class="jd-header-title" style="max-width: 640px;margin: 0 auto">
                    个人中心
                </div>
            </div>
        </header>
    </div>
</header>
<a name="top"></a>
<div class="common-wrapper">

    <div class="myJD-content">
        <ul class="in-list bdbr-1px bdbt-1px">
            <a  href="javascript:void(0);" data-href="customer_level_list.html" style="" >
                <li>
                    <div class="in-item  my-item">
                        <div class="couponIn-icon w-18 padding_top">
                            <img src="/resources/wap/image/level.png" />
                        </div>
                        <div class="in-item-info my-item bdbr-1px ">
                            <div class="fl">
                                <span class="center-span">等级维护</span>
                            </div>
                            <div class="fr">
                                <span class="myJD-AllOrder">等级维护</span>
                                <span class="myJD-arrow"></span>
                            </div>
                        </div>
                    </div>
                </li>
            </a>
            <a  href="javascript:void(0);" data-href="my_customer_list.html" style="" id="shop_apply">
                <li>
                    <div class="in-item  my-item">
                        <div class="couponIn-icon w-18 padding_top">
                            <img src="/resources/wap/image/business_users.png" />
                        </div>
                        <div class="in-item-info my-item bdbr-1px ">
                            <div class="fl">
                                <span class="center-span">我的商户</span>
                            </div>
                            <div class="fr">
                                <span class="myJD-AllOrder">商家等级维护</span>
                                <span class="myJD-arrow"></span>
                            </div>
                        </div>
                    </div>
                </li>
            </a>


            <a  href="javascript:void(0);" data-href="exclude_product_list.html" style="">
                <li>
                    <div class="in-item  my-item">
                        <div class="couponIn-icon w-18 padding_top">
                            <img src="/resources/wap/image/plus.png" />
                        </div>
                        <div class="in-item-info my-item bdbr-1px ">
                            <div class="fl">
                                <span class="center-span">增售商品</span>
                            </div>
                            <div class="fr">
                                <span class="myJD-AllOrder" >增售商品</span>
                                <span class="myJD-arrow"></span>
                            </div>
                        </div>
                    </div>
                </li>
            </a>
            <a  href="javascript:void(0);" data-href="has_product_list.html"  style="">
                <li>
                    <div class="in-item  my-item">
                        <div class="couponIn-icon w-18 padding_top">
                            <img src="/resources/wap/image/product.png" />
                        </div>
                        <div class="in-item-info my-item bdbr-1px ">
                            <div class="fl">
                                <span class="center-span">所经营商品</span>
                            </div>
                            <div class="fr">
                                <span class="myJD-AllOrder" >维护经营商品</span>
                                <span class="myJD-arrow"></span>
                            </div>
                        </div>
                    </div>
                </li>
            </a>

            <a   href="javascript:void(0);" data-href="order_list.html" style="">
                <li>
                    <div class="in-item  my-item">
                        <div class="couponIn-icon w-18 padding_top">
                            <img src="/resources/wap/image/order.png" />
                        </div>
                        <div class="in-item-info my-item bdbr-1px ">
                            <div class="fl">
                                <span class="center-span">订单管理</span>
                            </div>
                            <div class="fr">
                                <span class="myJD-AllOrder">订单信息</span>
                                <span class="myJD-arrow"></span>
                            </div>
                        </div>
                    </div>
                </li>
            </a>
           <!-- <a  href="/pages/wx/bank_card_list.jsp" style="">
                <li>
                    <div class="in-item  my-item">
                        <div class="couponIn-icon w-18 padding_top">
                            <img src="/resources/wap/image/statistics.png" />
                        </div>
                        <div class="in-item-info my-item bdbr-1px ">
                            <div class="fl">
                                <span class="center-span">统计</span>
                            </div>
                            <div class="fr">
                                <span class="myJD-AllOrder">业务数据统计</span>
                                <span class="myJD-arrow"></span>
                            </div>
                        </div>
                    </div>
                </li>
            </a>-->
        </ul>
    </div>


</div>
<div class="toolbar tabbar tabbar-labels">
    <div class="toolbar-inner">
        <a href="order_list.html" class="tab-link">
            <i class="material-icons"><img src="/resources/wap/image/order_list.png" width="32px"></i>
            <span class="tabbar-label">订单</span></a>
       <!-- <a href="cart.html" class="tab-link">
            <i class="material-icons"><img src="/resources/wap/image/cart.png"  width="32px"></i>
            <span class="tabbar-label">购物车</span></a>-->
        <a href="user_center.html" class="tab-link active ">
            <i class="material-icons"><img src="/resources/wap/image/my.png"  width="32px"></i>
            <span class="tabbar-label">我的</span></a></div>
</div>
</body>
<script type="text/javascript">
    $(function () {
        $("a[data-href]").click(function () {
            var url = $(this).attr("data-href");
            pageGoto(url);
        });
        getUserInfo();
        loadCnt();
    });
    function loadCnt(){
        $.ajax({
            url:"/wx/userInfo/loadCnt.json?ran="+Math.random(),
            type:"post",
            dataType:"json",
            success:function(res){
                if(res.success){
                    if(res.data!=null){
                        $("#browse_cnt").html(res.data.browseCnt);
                        $("#shop_cnt").html(res.data.shopCnt);
                        $("#product_cnt").html(res.data.productCnt);
                    }
                }
            },
            error:function(){}
        });
    }
    function getUserInfo() {
        $.ajax({
            url:"/wx/userInfo/getUserInfo.json?ran="+Math.random(),
            type:"post",
            dataType:"json",
            success:function(result){
                if(result.success){
                    var data  = result.data;
                    var member = data.member;
                    var orderStatistics = data.orderStatistics;
                    var isShop = data.isShop;
                    if(isShop=='1'){
                        $("#shop_apply").css("display","none");
                        $("#shop_manage").css("display","block");
                    }else{
                        $("#shop_apply").css("display","block");
                        $("#shop_manage").css("display","none");
                    }

                    initPageDate(member,".member");
                    $("#point").html(member.point);
                    $("#amount").html(member.amount);
                    initPageDate(orderStatistics,".orderStatistics");
                    $(".orderStatistics").each(function (i,element) {
                        var  count = $(element).html();
                        if(count>0){
                            $(element).addClass(" my-count re-count");
                        }

                    });

                    $("#imageSpan").append("<img src='"+member.headImage+"' />");
                }
            },
            error:function(){}
        });
    }

    function checkIn(){
        $.ajax({
            url:"/wx/userInfo/checkIn.json?ran="+Math.random(),
            type:"post",
            dataType:"json",
            success:function(result){
                if(result.success){
                    alert("签到成功!");
                    window.location.reload();
                }else {
                    alert(result.msg);
                }
            },
            error:function(){}
        });
    }

    function gotoOrder(status){
        window.location.href="/pages/wx/order_list.jsp?orderStatus="+status;
    }

    function goShopManage(){
        $.ajax({
            url:"/wx/shop/checkStatus.json?r="+Math.random(),
            type:"post",
            dataType:"json",
            success:function(res){
                if(res.success){
                    window.location.href = "/pages/shop/login.jsp";
                }else{
                    alert(res.msg);
                }
            },
            error:function(){}
        })
    }
</script>
</html>
